<?php
ini_set('error_reporting', 6143);
ini_set('display_errors','1');
define('IN_LC', true);
define('MM_ID', -1);

include_once("validate.php");
include_once("includes/style.php");
include_once("includes/car_details.php");
include_once("includes/addMessage.php");


$done = false;
// are we showing an actual profile?
if(isset($_GET['id']))
{
	// Create query
	$q = "SELECT * FROM `". CARS_TABLE ."` "
		."WHERE c_id = ". $_GET['id'];
			
	
	// Run query
	$res = $db->sql_query($q);
	if ( $row = $db->sql_fetchrow($res)  )
	{
		$style = new style(true);	
		include_once('includes/side_menu.php');
		$style->addRenderLeft(new side_menu('cars', $_GET['id']));
		if(isset($_GET['mode']))
		{
			$car = new car_details($row, $_GET['mode']);
		}
		else
		{
			$car = new car_details($row, 'MiniSolo');
		}
		$style->addRenderRight($car);
		$style->render();
		$done = true;
	}
}

if(!$done)
{
	Header("Location: index.php");
}


echo $db->num_queries;
?>